#!coding:utf8
'''
Created on Nov 7, 2012

@author: join
'''
from xml.dom.minidom import parseString

def test_parse():
    s='<Resp errcode="2" errdesc="����Ϸ��������" batchid="fffd87d027ee11e2b4d254e6fc72b618" lotteryCode="06"></Resp>'
    dom=parseString(s)
    print dom.getElementsByTagName("Resp")[0]

def test_str():
    s="123456781234"
    s=s[0:4]+"-"+s[4:8]+"-"+s[8:]
    return s


def test_file():
    with file('aa') as f:
        result=f.readline()
        print result
    f.close()
    with file('aa','w') as f:
        result = 0 if not result else int(result)
        result = result+10
        print result
        f.write('%s'%result)
    f.close()
print test_file()